1. Technical Field
The present disclosure relates to the field of computers, and specifically to computer-generated illustrations. Still more particularly, the present disclosure relates to ray tracing in computer-generated illustrations.
2. Description of the Related Art
Ray tracing is a technique used in computer-generated illustrations and animation to reverse-emulate the properties of light, color, texture, and shading of objects. That is, in order to replicate how images appear to a viewer's eye, a pathway of light coming from a particular image is traced backwards to the image and any other involved objects. For example, consider the scene depicted in FIG. 1. Three spheres are depicted. Sphere 102 is a green sphere, sphere 104 is a blue sphere, and sphere 106 is a red sphere. When illuminated by a light source 108 (e.g., a white light bulb, the sun, etc.), the green, blue and red spheres 102-106 will be visible to a viewer's eye 110. Note, however, that there are several sets of light rays involved in this scenario.
First, there are illumination light rays 112 coming from the light source 108 (assuming that spheres 102-106 are not internally or otherwise self-illuminated). When the illumination light rays 112 strike the green sphere 102, the green sphere 102 absorbs all frequencies of light from the illumination light rays 112 except for those in the green spectrum. Similarly, the blue sphere 104 absorbs all frequencies of light from the illumination light rays 112 except for blue, and the red sphere 106 absorbs all frequencies of light from the illumination light rays 112 except for red. Some of the non-absorbed light from spheres 102-106 is depicted as dashed lines, which are referenced as secondary light rays 114. These secondary light rays 114 cause the spheres 102-106 to be shaded, thus appearing to be colors other than their respective original colors of green, blue, and red. For example, the secondary light ray 115 coming from red sphere 106 “shades” the blue sphere 104, thus causing the blue sphere 104 to appear to be magenta (in compliance with a standard color wheel). Therefore, a final image ray 117 (coming from blue sphere 104 and one of the set of final rays 116) appears to be magenta, rather than blue, to the viewer's eye 110. That is, the final image ray 117 includes both the primary blue rays from the blue sphere 104 as well as reflected red rays from the red sphere 106. Reflected light from the other spheres likewise interact to produce shaded colors for the spheres that are different from their original hues.
Referring now to FIG. 2, an exemplary ray tracing for a computer-generated representation of the scene shown in FIG. 1 is presented. A computer has generated virtual images of the spheres shown in FIG. 1. These virtual spheres are depicted as virtual spheres 202, 204, and 206, and correspond in appearance (shape, size, hue, shading, etc.) to the spheres 102, 104, and 106 shown in FIG. 1. The spheres are contained within a boundary (e.g., a box or “bounding volume”) 208. Virtual secondary light rays 214, coming from the virtual spheres 202, 204, and 206 are also generated. In order to present to a viewer (e.g., a camera, a monitor, etc.) 210 the same image as seen by the user's eye 110, rays are backwards traced from the viewer 210 and aligned on a grid 212 for spatial orientation. That is, final virtual rays 216 are traced through the grid 212 from the viewer 210 to the virtual spheres 202-206. When one of the final virtual rays 216 hits an object, a calculation is made to determine the direction in which this ray would bounce off the object. By “seeing” where the ray would bounce (as a virtual secondary light ray 214), a perception is achieved that the object likewise “sees” the other object, and is thus shaded/recolored. As such, the final result is that ray tracing allows a computer artist to mimic how light shading occurs in the real world by back-tracking the final and secondary light rays, thus recreating such shading in the computer-generated image.
As shown in FIG. 2, there are numerous virtual secondary light rays 214. For purposes of simplicity, only a few secondary light rays 214 have been illustrated in FIG. 2. In practice, however, there are tens or hundreds of secondary light rays 214 coming from every object within boundary 208. This large number of secondary light rays 214, and the processing resources required to generate them, can quickly cause a marked degradation in the processing ability of the computer that is generating the virtual images. This degradation can result in pixels breaking up, animation becoming stuttered, and even a crash of the system, resulting in the total loss of the virtual image.